// HistoryBridge.cpp
#include "HistoryBridge.h"
#include "HistoryBased.h"

using namespace std;

static HistoryBased *model = nullptr;

HistoryBridge::HistoryBridge() {
    model = new HistoryBased();
}

HistoryBridge::HistoryBridge(string path){
    model = new HistoryBased(path);
}

HistoryBridge::~HistoryBridge() {
    delete model;
    model = nullptr;
}

void HistoryBridge::set_path_and_init_model(string path){
    model->set_record_path(path);
    model->init();
}

std::string HistoryBridge::chat(const std::string& input) {
    if (model)
        return model->chat_with_model(input);
    else
        return "模型未初始化。";
}
